<template>
	<uni-tag :inverted="true" :text="tagText" :type="tagType" size="mini" :class="tagClass"  />
</template>

<script>
	export default {
		name: 'tag',
		
			props:{
					text:'',
					type:'',
					class:''
				},

		data() {
			return {
				tagText: '已上架',
				tagType: 'success',
				tagClass: 'tag-green'
			}
		},
		
		mounted() {
			this.changeStyle(this.text, this.type, this.class)
		},
		
		methods: {
			
			changeStyle(newText, newType, newClass) {
				this.tagText = this.text;
				this.tagType = this.type;
				this.tagClass = this.class;
			}
		}
	}
</script>

<style lang="scss">
	.tag-green {
		background-color: rgba(#71d84b, 0.2);
		border: 0;
		padding: 5upx 15upx;
	}

	.tag-yellow {
		background-color: rgba(#ffbc13, 0.2);
		border: 0;
		padding: 5upx 15upx;
	}

	.tag-blue {
		background-color: rgba(#6086d8, 0.2);
		border: 0;
		padding: 5upx 15upx;
	}
</style>